import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
import student from '@/components/student'
import teacher from '@/components/teacher'
import defaults from '@/components/defaults'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/index',
      name: 'index',
      component: index,
      children:[
        {path:'student', component: student},
        {path:'teacher', component: teacher}
      ]
    },

  ]
})
const   originalPush=Router.prototype.push
Router.prototype.push=function push(location,onResolve,onReject){
  if(onResolve || onReject) return  originalPush.call(this,location,onResolve,onReject)
  return originalPush.call(this,location).catch(err=>err)
}
